package me.shiqiang.im.command;

import me.shiqiang.im.service.ServerNodeClient;
import me.shiqiang.im.util.IpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.net.InetAddress;

/**
 * @author cuishiqiang
 * @date 2017/12/12 下午1:41
 */
@Component
public class ServerStartCmd implements CommandLineRunner{

    @Value("${server.id}")
    private String serverId;

    @Autowired
    ServerNodeClient client;

    @Override
    public void run(String... args) throws Exception {
        InetAddress ipAddress = IpUtils.getInstance().getLocalHostLANAddress();
        if (ipAddress != null) {
            String hostAddress = ipAddress.getHostAddress();
        }
    }


}
